#ifndef __OFFECT_H_
#define __OFFECT_H_

/* pt_regs 结构体偏移量 - 手动计算 */
#define S_FRAME_SIZE    272     // sizeof(struct pt_regs) = 31*8 + 8 + 8 + 8 = 248 + 24 = 272
#define S_X0           0       // regs[0]
#define S_X1           8       // regs[1] 
#define S_X2           16      // regs[2]
#define S_X3           24      // regs[3]
#define S_X4           32      // regs[4]
#define S_X5           40      // regs[5]
#define S_X6           48      // regs[6]
#define S_X7           56      // regs[7]
#define S_X8           64      // regs[8]
#define S_X10          80      // regs[10]
#define S_X12          96      // regs[12]
#define S_X14          112     // regs[14]
#define S_X16          128     // regs[16]
#define S_X18          144     // regs[18]
#define S_X20          160     // regs[20]
#define S_X22          176     // regs[22]
#define S_X24          192     // regs[24]
#define S_X26          208     // regs[26]
#define S_X28          224     // regs[28]
#define S_FP           232     // regs[29] - Frame Pointer
#define S_LR           240     // regs[30] - Link Register
#define S_SP           248     // sp
#define S_PC           256     // pstate
#define S_PSTATE       264     // pc

/* task_struct 结构体偏移量 */
#define THREAD_CPU_CONTEXT 16   // offsetof(task_struct, cpu_context)
#define TI_PREEMPT        148    // offsetof(task_struct, preempt_count)  
#define NEED_RESCHED      144    // offsetof(task_struct, need_resched)


#endif // !__OFFECT_H_
